package services

import (
    "github.com/gin-gonic/gin"
	"hitme/go-api/logic/form"
	"hitme/go-api/logic/global"
	"hitme/go-api/logic/repository"
)

type userService struct {}

var UserService userService

// Profile 获取用户详情
func (u *userService) Profile (c *gin.Context, req form.UserProfileReqForm) (*form.UserProfileRespForm, error) {
	// 获取用户信息
	userInfo := repository.UserRep.FindById(global.UserId)

	return &form.UserProfileRespForm{
		Nickname: userInfo.Nickname,
		Avatar: userInfo.Avatar,
		Gender: userInfo.Gender,
		City: userInfo.City,
		Province: userInfo.Province,
	}, nil
}